﻿CREATE TABLE [dbo].[GoodsReceivedNote] (
    [Id]                  UNIQUEIDENTIFIER ROWGUIDCOL NOT NULL,
    [RefNumber]           NVARCHAR (50)    NOT NULL,
    [SupplierId]          UNIQUEIDENTIFIER NOT NULL,
    [DnNumber]            NVARCHAR (50)    NULL,
    [DeliverDate]         DATETIME         NOT NULL,
    [CountryOfficeId]     UNIQUEIDENTIFIER NOT NULL,
    [OrderRequestId]      UNIQUEIDENTIFIER NULL,
    [PurchaseOrderId]     UNIQUEIDENTIFIER NULL,
    [Remarks]             NTEXT            NULL,
    [GoodCondition]       BIT              NULL,
    [CorrectQuantity]     BIT              NULL,
    [GoodsDamaged]        BIT              NULL,
    [Shortfall]           BIT              NULL,
    [DeliveredBy]         NVARCHAR (250)   NOT NULL,
    [DeliveryCompany]     NVARCHAR (250)   NULL,
    [VehicleRegNumber]    NVARCHAR (50)    NULL,
    [DriverLicenseNumber] NVARCHAR (50)    NULL,
    [ReceivedBy]          UNIQUEIDENTIFIER NOT NULL,
    [CountryProgrammeId]  UNIQUEIDENTIFIER NOT NULL,
    [Index]               BIGINT           IDENTITY (1, 1) NOT NULL,
    [Verified]            BIT              NOT NULL
);




GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Goods Received in Good Condition', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'GoodsReceivedNote', @level2type = N'COLUMN', @level2name = N'GoodCondition';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Goods Received in Correct Quantity', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'GoodsReceivedNote', @level2type = N'COLUMN', @level2name = N'CorrectQuantity';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Some or All Goods Received are Damaged', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'GoodsReceivedNote', @level2type = N'COLUMN', @level2name = N'GoodsDamaged';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Goods Received are less than Goods Expected', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'GoodsReceivedNote', @level2type = N'COLUMN', @level2name = N'Shortfall';

